﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

    class Program
    {
        static void Main()
        {
            int n;
            int k;
            do
            {
                Console.Write("Enter K <1: ");
                k = Convert.ToInt32(Console.ReadLine());
                Console.Write("Enter N <{0}: ", k);
                n = Convert.ToInt32(Console.ReadLine());
                if ((n < 1) || (k < 1) || (n < k)) 
                {
                    Console.WriteLine("!!! (1<K<N)");
                }
            } while ((n < 1) || (k < 1) || (n < k));
            decimal factorialK = 1;
            decimal factorialN = 1;
            for (int i = k; i > 1; i--) 
            {
                factorialK *= i;
                
            }
            for (int j = n; j > 1; j--) 
            {
                factorialN *= j;
            }
            decimal factDivid = (factorialN / factorialK);
            Console.WriteLine("N{0}!/K{1}! = {2}", factorialK, factorialN, factDivid);
        }
    }

